<!-- header start -->
#include("header.html")
<!-- header end -->
<div class="banner minBanner" id="banner">
	<ul class="list">
     #slide_list(count=3,gid=2)
	#for(slide : slides)
     <li><img src="#(slide.image)" alt="#(slide.title)" /></li>
   	#end
	#end
     </ul>
	<div class="tip"></div>
    
  <div class="clear"></div>
</div>

	<!--banner end-->
	<div class="submian w">
      <div class="ne_left"></div>
      <div class="ne_right"></div>
		<!-- left start -->
	#include("left.html")
	<!-- left end -->
		<!--right-->
		<div class="subright fr">
        <div class="sobtitle">
	<p class="fl">#(currentCategory.name)</p>
	<div class="sitepath fr">当前位置：#include("position.html")</div>
	<i></i>
</div>
			<div class="recommend-form">
        	<form name="formPost" id="formPost" onsubmit="return submsg(this);"   method="POST" >

        	<div class="main">
            	<div class="row-1 ico-name required">
                	<input type="text" class="txt" name="contact"  value="" placeholder="访客姓名" empty="请输入您的的称呼" maxlength="5">
                    <i class="tip">*</i>
                </div>
                <div class="row-1 ico-phone required">
                	<input type="text" class="txt" name="mobile"  value="" placeholder="联系电话" empty="请输入您的联系电话" error="请输入正确的联系电话" maxlength="15">
                    <i class="tip">*</i>
                </div>

                <div class="row-2">
                	<textarea class="text" placeholder="请填写您的需求信息..." name="content"></textarea>
                </div>
                <div class="row-3">
                    <input type="text" class="code" name="captcha" id="captcha" value="" placeholder="验证码" empty="请输入验证码" maxlength="4">
                    <img id="captchaImage" src="#(currentSite.url)/common/captcha/image" onclick="this.src='#(currentSite.url)/common/captcha/image?'+Math.round(Math.random()*10);" class="code">
                </div>
                <div class="row-3">
                    <input type="submit" class="submit" value="提交">
                    <input type="reset" class="reset" value="重置">
                </div>
                <div class="clear"></div>
            </div>
        	
</form>


        </div>
		</div>
		<!--right-->
		<div class="clear"></div>
	</div>
	<!--foot-->
<script>

//ajax提交留言
function submsg(obj){
  var url='#(currentSite.url)/api/guestbook';
  var contact=$(obj).find("#contact").val();
  var mobile=$(obj).find("#mobile").val();
  var content=$(obj).find("#content").val();
  var captcha=$(obj).find("#captcha").val();
  
  $.ajax({
    type: 'POST',
    url: url,
    dataType: 'json',
    data: {
    	contact: contact,
    	mobile: mobile,
    	content: content,
    	captcha: captcha
    },
    success: function (response, status) {
      if(response.type=="success"){
		 alert("谢谢您的反馈，我们会尽快联系您！");
		 $(obj)[0].reset(); 
      }else{
    	 alert(response.data);
      }
    },
    error:function(xhr,status,error){
      alert('返回数据异常！');
    }
  });
  return false;
}
</script>
<!-- footer start -->
#include("footer.html")
<!-- footer end -->